From 6a97a169217cfbc14f4e1244159b44c564b2cf12 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Wed, 10 Dec 2003 03:46:30 +0000 Subject: [PATCH] Use "Home" rather than "Username's Home" (#125964). 2003-12-09 Federico Mena Quintero * gtk/gtkfilechooserdefault.c (shortcuts_append_home): Use "Home" rather than "Username's Home" (#125964). (shortcuts_selection_changed_cb): New callback, check the sensitivity of the Remove Bookmark button at the right time. (shortcuts_row_activated_cb): It is not necessary to check the sensitivity here. --- ChangeLog | 9 +++++ ChangeLog.pre-2-10 | 9 +++++ ChangeLog.pre-2-4 | 9 +++++ ChangeLog.pre-2-6 | 9 +++++ ChangeLog.pre-2-8 | 9 +++++ .../gtk/migrating-GtkFileChooser.sgml | 3 +- gtk/gtkfilechooserdefault.c | 39 ++++++++++--------- 7 files changed, 68 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index e854fc25a5..7b4735dbf9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2003-12-09 Federico Mena Quintero + + * gtk/gtkfilechooserdefault.c (shortcuts_append_home): Use "Home" + rather than "Username's Home" (#125964). + (shortcuts_selection_changed_cb): New callback, check the + sensitivity of the Remove Bookmark button at the right time. + (shortcuts_row_activated_cb): It is not necessary to check the + sensitivity here. + Wed Dec 10 00:06:24 2003 Matthias Clasen Improve the GDK API for dealing with group leaders (#119375): diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index e854fc25a5..7b4735dbf9 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,12 @@ +2003-12-09 Federico Mena Quintero + + * gtk/gtkfilechooserdefault.c (shortcuts_append_home): Use "Home" + rather than "Username's Home" (#125964). + (shortcuts_selection_changed_cb): New callback, check the + sensitivity of the Remove Bookmark button at the right time. + (shortcuts_row_activated_cb): It is not necessary to check the + sensitivity here. + Wed Dec 10 00:06:24 2003 Matthias Clasen Improve the GDK API for dealing with group leaders (#119375): diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index e854fc25a5..7b4735dbf9 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,12 @@ +2003-12-09 Federico Mena Quintero + + * gtk/gtkfilechooserdefault.c (shortcuts_append_home): Use "Home" + rather than "Username's Home" (#125964). + (shortcuts_selection_changed_cb): New callback, check the + sensitivity of the Remove Bookmark button at the right time. + (shortcuts_row_activated_cb): It is not necessary to check the + sensitivity here. + Wed Dec 10 00:06:24 2003 Matthias Clasen Improve the GDK API for dealing with group leaders (#119375): diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index e854fc25a5..7b4735dbf9 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,12 @@ +2003-12-09 Federico Mena Quintero + + * gtk/gtkfilechooserdefault.c (shortcuts_append_home): Use "Home" + rather than "Username's Home" (#125964). + (shortcuts_selection_changed_cb): New callback, check the + sensitivity of the Remove Bookmark button at the right time. + (shortcuts_row_activated_cb): It is not necessary to check the + sensitivity here. + Wed Dec 10 00:06:24 2003 Matthias Clasen Improve the GDK API for dealing with group leaders (#119375): diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index e854fc25a5..7b4735dbf9 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,12 @@ +2003-12-09 Federico Mena Quintero + + * gtk/gtkfilechooserdefault.c (shortcuts_append_home): Use "Home" + rather than "Username's Home" (#125964). + (shortcuts_selection_changed_cb): New callback, check the + sensitivity of the Remove Bookmark button at the right time. + (shortcuts_row_activated_cb): It is not necessary to check the + sensitivity here. + Wed Dec 10 00:06:24 2003 Matthias Clasen Improve the GDK API for dealing with group leaders (#119375): diff --git a/docs/reference/gtk/migrating-GtkFileChooser.sgml b/docs/reference/gtk/migrating-GtkFileChooser.sgml index 24071d107b..48c5f04958 100644 --- a/docs/reference/gtk/migrating-GtkFileChooser.sgml +++ b/docs/reference/gtk/migrating-GtkFileChooser.sgml @@ -1,6 +1,5 @@ - Migrating from GtkFileSelection to GtkFileChooser Federico Mena-Quintero @@ -12,6 +11,8 @@ + Migrating from GtkFileSelection to GtkFileChooser + #GtkFileChooser, starting with GTK+ 2.4, is the new set of APIs for file selection widgets and dialogs. Previous versions of GTK+ diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c index 766111b200..1f837c9f74 100644 --- a/gtk/gtkfilechooserdefault.c +++ b/gtk/gtkfilechooserdefault.c @@ -209,10 +209,10 @@ static void filter_combo_changed (GtkComboBox *combo_box, static void tree_selection_changed (GtkTreeSelection *tree_selection, GtkFileChooserDefault *impl); -static void shortcuts_row_activated (GtkTreeView *tree_view, - GtkTreePath *path, - GtkTreeViewColumn *column, - GtkFileChooserDefault *impl); +static void shortcuts_row_activated_cb (GtkTreeView *tree_view, + GtkTreePath *path, + GtkTreeViewColumn *column, + GtkFileChooserDefault *impl); static gboolean shortcuts_select_func (GtkTreeSelection *selection, GtkTreeModel *model, GtkTreePath *path, @@ -556,24 +556,18 @@ shortcuts_insert_path (GtkFileChooserDefault *impl, static void shortcuts_append_home (GtkFileChooserDefault *impl) { - const char *name; const char *home; GtkFilePath *home_path; - char *label; GError *error; - name = g_get_user_name (); - label = g_strdup_printf (_("%s's Home"), name); - home = g_get_home_dir (); home_path = gtk_file_system_filename_to_path (impl->file_system, home); error = NULL; - impl->has_home = shortcuts_insert_path (impl, -1, home_path, FALSE, label, &error); + impl->has_home = shortcuts_insert_path (impl, -1, home_path, FALSE, _("Home"), &error); if (!impl->has_home) error_getting_info_dialog (impl, home_path, error); - g_free (label); gtk_file_path_free (home_path); } @@ -1060,6 +1054,14 @@ shortcuts_drag_data_received_cb (GtkWidget *widget, g_slist_free (uris); } +/* Callback used when the selection in the shortcuts tree changes */ +static void +shortcuts_selection_changed_cb (GtkTreeSelection *selection, + GtkFileChooserDefault *impl) +{ + bookmarks_check_remove_sensitivity (impl); +} + /* Creates the widgets for the shortcuts and bookmarks tree */ static GtkWidget * create_shortcuts_tree (GtkFileChooserDefault *impl) @@ -1093,9 +1095,12 @@ create_shortcuts_tree (GtkFileChooserDefault *impl) gtk_tree_selection_set_select_function (selection, shortcuts_select_func, impl, NULL); + + g_signal_connect (selection, "changed", + G_CALLBACK (shortcuts_selection_changed_cb), impl); g_signal_connect (impl->shortcuts_tree, "row-activated", - G_CALLBACK (shortcuts_row_activated), impl); + G_CALLBACK (shortcuts_row_activated_cb), impl); g_signal_connect (impl->shortcuts_tree, "drag-data-received", G_CALLBACK (shortcuts_drag_data_received_cb), impl); @@ -2407,10 +2412,10 @@ tree_selection_changed (GtkTreeSelection *selection, /* Callback used when a row in the shortcuts list is activated */ static void -shortcuts_row_activated (GtkTreeView *tree_view, - GtkTreePath *path, - GtkTreeViewColumn *column, - GtkFileChooserDefault *impl) +shortcuts_row_activated_cb (GtkTreeView *tree_view, + GtkTreePath *path, + GtkTreeViewColumn *column, + GtkFileChooserDefault *impl) { GtkTreeIter iter; GtkFilePath *model_path; @@ -2418,8 +2423,6 @@ shortcuts_row_activated (GtkTreeView *tree_view, if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (impl->shortcuts_model), &iter, path)) return; - bookmarks_check_remove_sensitivity (impl); - /* Set the current folder */ gtk_tree_model_get (GTK_TREE_MODEL (impl->shortcuts_model), &iter, SHORTCUTS_COL_PATH, &model_path, -1); -- 2.30.2